﻿Type.registerNamespace("Microsoft.Live.ClientControls.VE.Extenders")
Microsoft.Live.ClientControls.VE.Extenders.SetScaleBarKM=function(element){
Microsoft.Live.ClientControls.VE.Extenders.SetScaleBarKM.initializeBase(this,[element])
this._toggleMode
this._mapControlID}
Microsoft.Live.ClientControls.VE.Extenders.SetScaleBarKM.prototype={
initialize : function(){
Microsoft.Live.ClientControls.VE.Extenders.SetScaleBarKM.callBaseMethod(this,'initialize')
$addHandler(this.get_element(),"click",Function.createDelegate(this,this._onClick))
},
get_ToggleMode : function(){
return this._toggleMode
},
set_ToggleMode : function(value){
this._toggleMode=value
},
get_MapControlID : function(){
return this._mapControlID
},
set_MapControlID : function(value){
this._mapControlID=value
},
_onClick : function(e){
var mapcontrol=$find(this._mapControlID)
if(mapcontrol&&VEDistanceUnit){
switch(this._toggleMode){
case 0:
mapcontrol.set_ScaleBarDistanceUnit(VEDistanceUnit.Miles)
break
case 1:
mapcontrol.set_ScaleBarDistanceUnit(VEDistanceUnit.Kilometers)
break
case 2:
if(mapcontrol.get_ScaleBarDistanceUnit()==VEDistanceUnit.Kilometers){
mapcontrol.set_ScaleBarDistanceUnit(VEDistanceUnit.Miles)
}else{
mapcontrol.set_ScaleBarDistanceUnit(VEDistanceUnit.Kilometers)}
break}}
e.preventDefault()
},
dispose : function(){
$clearHandlers(this.get_element())
Microsoft.Live.ClientControls.VE.Extenders.SetScaleBarKM.callBaseMethod(this,'dispose')}}
Microsoft.Live.ClientControls.VE.Extenders.SetScaleBarKM.registerClass("Microsoft.Live.ClientControls.VE.Extenders.SetScaleBarKM",Sys.UI.Behavior)
if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded()
